home *** CD-ROM | disk | FTP | other *** search
/ Aminet 25 / Aminet 25 (1998)(GTI - Schatztruhe)[!][Jun 1998].iso / Aminet / dev / amos / AMOS0398.lzh / AMOSLIST / 000179_amos-request@svcs1.digex.net_Fri Mar 20 01:36:20 1998.msg < prev    next >
Text File  |  1998-04-01  |  2KB  |  58 lines

  1. >From amos-request@svcs1.digex.net  Fri Mar 20 01:36:20 1998
  2. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
  3.     by pony-2.mail.digex.net (8.8.8/8.8.8) with ESMTP id BAA10302
  4.     for <mcox@access.digex.net>; Fri, 20 Mar 1998 01:36:20 GMT
  5. Received: (from daemon@localhost)
  6.     by svcs1.digex.net (8.8.5/8.8.5) id NAA02767
  7.     for amos-out; Thu, 19 Mar 1998 13:26:05 -0500 (EST)
  8. Received: from pony-2.mail.digex.net (pony-2.mail.digex.net [204.91.241.6])
  9.     by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id NAA02764
  10.     for <amos-list@svcs1.digex.net>; Thu, 19 Mar 1998 13:26:05 -0500 (EST)
  11. Received: from star.flashnet.it (star.flashnet.it [194.247.160.2])
  12.     by pony-2.mail.digex.net (8.8.8/8.8.8) with ESMTP id NAA26995
  13.     for <amos-list@access.digex.net>; Thu, 19 Mar 1998 13:25:57 -0500 (EST)
  14. Received: from ip054.pool-04.flashnet.it (Berionne@ip054.pool-04.flashnet.it [194.247.161.54])
  15.     by star.flashnet.it (8.8.7/8.8.6) with SMTP id TAA05432
  16.     for <amos-list@access.digex.net>; Thu, 19 Mar 1998 19:25:54 +0100
  17. Date: 18 Mar 98 23:08:45 +0100
  18. From: "Michele Berionne" <berionne@flashnet.it>
  19. Subject: Re: Sorting problems
  20. To: "Nathan Reynolds" <amos-list@access.digex.net>
  21. In-Reply-To: <004901bd526a$b4149260$6c4d08c3@nsl>
  22. Message-ID: <816.381T2299T13885424@flashnet.it>
  23. MIME-Version: 1.0
  24. Content-type: text/plain; charset=iso-8859-1
  25. Content-transfer-encoding: 8bit
  26. X-Mailer: THOR 2.5a (Amiga;TCP/IP)
  27. Status: O
  28. X-Status: 
  29.  
  30. Hello!
  31.  
  32.  > Yeah, sorry about that.  I'm not great with sorting algorithms.  I've been
  33.  > told that a flag would be a good idea, but I'm not sure how to implement
  34.  > it. How about an updated algorithm?
  35.  
  36. A sorting algorithm with a flag is done in this way.
  37.  
  38. Repeat
  39.    FLAG=False
  40.    For T=1 to N
  41.       If A(T)>A(T+1)
  42.          Swap A(T),A(T+1)
  43.          FLAG=True
  44.       End If
  45.    Next
  46. Until Not FLAG
  47.  
  48. ...well, actually I have no time now to see if I did stupid mistakes.
  49. Moreover you can implement the check (>) and the swap routine as you need
  50. them.
  51.  
  52. Bye
  53.  
  54.     berionne@flashnet.it                       >>Flagger<<
  55.   +---------------------------------------------------------------+
  56.   |���BASIC programmers never die, they GOSUB and don't RETURN.   |
  57.   +---------------------------------------------------------------+
  58.